package com.itheima.server.service;

import com.itheima.domain.mongo.UserLocation;
import com.itheima.dubbo.api.UserLocationApi;
import com.itheima.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

/**
 * @author 阿鹏
 * @date 2021/2/4 20:10
 */
@Service
public class BaiduService {

    @Reference
    private UserLocationApi userLocationApi;

    public ResponseEntity saveLocation(Double longitude, Double latitude, String address) {

        userLocationApi.save(latitude, longitude, address, UserHolder.getUserId());
        return ResponseEntity.ok(null);
    }
}
